import axios from 'axios'

// export const getList = (page, pageSize) => {
// 	return axios.request({
// 		url: '/worker',
// 		method: 'get',
// 		params: {
// 			page,
// 			pageSize
// 		}
// 	})
// }

// export const getCount = () => {
// 	return axios.request({
// 		url: '/workernum',
// 		method: 'get'
// 	})
// }

export default {
	getList: (page, pageSize, word) => {
		return axios.request({
			url: '/worker',
			method: 'get',
			params: {
				page,
				pageSize,
				word
			}
		})
	},
	getCount: (word) => {
		return axios.request({
			url: '/workernum',
			method: 'get',
			params: {
				word
			}
		})
	},
	editWorker: (worker) => {
		return axios.request({
			url: '/worker',
			method: 'put',
			data: worker
		})
	},
	addWorker: (worker) => {
		return axios.request({
			url: '/worker',
			method: 'post',
			data: worker
		})
	},
	delWorker: (id) => {
		return axios.request({
			url: '/worker/' + id,
			method: 'delete'
		})
	}
}
